package com.example.monit.bean;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class ResponseRust {
    private String message;
    private int status;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime timestamp;
    private Object data;


    public static ResponseRust success_creat() {
        ResponseRust rus = new ResponseRust();
        rus.status = 201;
        rus.message = "Created";
        rus.timestamp = LocalDateTime.now();
        return rus;
    }

    public static ResponseRust success(Object data) {
        ResponseRust rus = new ResponseRust();
        rus.status = 200;
        rus.message = "OK";
        rus.timestamp = LocalDateTime.now();
        rus.data = data;
        return rus;
    }
}
